﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.hud {
    import Engine.Managers.*;
    import flash.display.*;
    import Events.*;
    import org.aswing.*;
    import Classes.*;
    import org.aswing.event.*;
    import Display.aswingui.*;
    import Modules.stats.types.*;

    public class ExpandedMainMenu extends ExpandedMenu {

        protected var m_moveButton:JButton;
        protected var m_rotateButton:JButton;
        protected var m_removeButton:JButton;
        protected var m_storeButton:JButton;
        protected var m_cursorButton:JButton;

        public function ExpandedMainMenu(_arg1=null, _arg2:Boolean=false){
            super(_arg1, _arg2);
        }
        override protected function makeContent():void{
            m_content = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER, 0);
            m_bg = (new EmbeddedArt.hud_act_bg() as DisplayObject);
            var _local1:AssetBackground = new AssetBackground(m_bg);
            m_content.setBackgroundDecorator(_local1);
            m_content.setPreferredWidth(m_bg.width);
            this.m_moveButton = new JButton();
            this.m_rotateButton = new JButton();
            this.m_removeButton = new JButton();
            this.m_storeButton = new JButton();
            this.m_cursorButton = new JButton();
            m_content.append(ASwingHelper.verticalStrut(15));
            makeButton(EmbeddedArt.hud_actMenu_move, this.m_moveButton, new JLabel(ZLoc.t("Main", "Move")));
            makeButton(EmbeddedArt.hud_actMenu_rotate, this.m_rotateButton, new JLabel(ZLoc.t("Main", "Rotate")));
            makeButton(EmbeddedArt.hud_actMenu_remove, this.m_removeButton, new JLabel(ZLoc.t("Main", "Remove")));
            if (Global.player.storageComponent.getAllStorageUnits().length > 0){
                makeButton(EmbeddedArt.hud_actMenu_store, this.m_storeButton, new JLabel(ZLoc.t("Main", "Store")));
            };
            makeButton(EmbeddedArt.hud_act_cursor, this.m_cursorButton, new JLabel(ZLoc.t("Main", "Tools")));
            m_content.append(ASwingHelper.verticalStrut(20));
            attachButtonHandlers(this.m_moveButton, this.onMoveMenuClick);
            attachButtonHandlers(this.m_rotateButton, this.onRotateMenuClick);
            attachButtonHandlers(this.m_removeButton, this.onRemoveMenuClick);
            attachButtonHandlers(this.m_storeButton, this.onStoreMenuClick);
            attachButtonHandlers(this.m_cursorButton, this.onCursorMenuClick);
        }
        private function onMoveMenuClick(_arg1:AWEvent):void{
            StatsManager.sample(100, StatsCounterType.HUD_COUNTER, StatsKingdomType.ACTION_MENU, "move");
            dispatchEvent(new UIEvent(UIEvent.ACTION_MENU_CLICK, UIEvent.MOVE));
        }
        private function onRotateMenuClick(_arg1:AWEvent):void{
            StatsManager.sample(100, StatsCounterType.HUD_COUNTER, StatsKingdomType.ACTION_MENU, "rotate");
            dispatchEvent(new UIEvent(UIEvent.ACTION_MENU_CLICK, UIEvent.ROTATE));
        }
        private function onRemoveMenuClick(_arg1:AWEvent):void{
            StatsManager.sample(100, StatsCounterType.HUD_COUNTER, StatsKingdomType.ACTION_MENU, "remove");
            dispatchEvent(new UIEvent(UIEvent.ACTION_MENU_CLICK, UIEvent.REMOVE));
        }
        private function onStoreMenuClick(_arg1:AWEvent):void{
            StatsManager.sample(100, StatsCounterType.HUD_COUNTER, StatsKingdomType.ACTION_MENU, "store");
            dispatchEvent(new UIEvent(UIEvent.ACTION_MENU_CLICK, UIEvent.STORE));
        }
        private function onCursorMenuClick(_arg1:AWEvent):void{
            StatsManager.sample(100, StatsCounterType.HUD_COUNTER, StatsKingdomType.ACTION_MENU, "tools");
            dispatchEvent(new UIEvent(UIEvent.ACTION_MENU_CLICK, UIEvent.CURSOR));
        }

    }
}//package Display.hud 
